let http = require('http')
/**
 * HTTP1.1 200 OK 响应行
 * 
 * Date: Fri,02 Feb 2018 13:57:46 GMT 响应头
 * Connection: keep-alive
 * Content-Length: 9
 * 
 * name=zfpx
 */
let server = http.createServer(function(req, res){
    res.statusCode = 200; //设置响应码
    res.setHeader('Content-Type', 'text/html/charset=utf8')
    console.log(res.getHeader())
    console.log(res.removeHeader())
    // writeHead一旦调用会立刻向客户端发送
    res.writeHead(200, {
        "Content-Type":"text/html;charset=utf8"
    })
    res.write('hello')
    res.write('world')
    res.end()
})
server.on('connection', function(socket){
    socket.on('end', function(){
        
    })
})
server.listen(8080)